package com.ccnode.codegenerator.taikaoback.security.jwt;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * JWT配置类
 */
@Configuration
@ConfigurationProperties(prefix = "jwt")
public class JwtConfig {
    
    /**
     * JWT密钥 - 必须至少512位用于HS512算法
     */
    private String secret = "parking_system_jwt_secret_key_for_hs512_algorithm_must_be_at_least_512_bits_long_this_is_a_very_secure_secret_key_2024";
    
    /**
     * Token有效期（秒）
     */
    private long expiration = 86400;
    
    /**
     * Token前缀
     */
    private String tokenPrefix = "Bearer ";
    
    /**
     * 请求头中的token字段
     */
    private String header = "Authorization";
    
    /**
     * 刷新Token有效期（秒）
     */
    private long refreshExpiration = 604800;

    public String getSecret() {
        return secret;
    }

    public void setSecret(String secret) {
        this.secret = secret;
    }

    public long getExpiration() {
        return expiration;
    }

    public void setExpiration(long expiration) {
        this.expiration = expiration;
    }

    public String getTokenPrefix() {
        return tokenPrefix;
    }

    public void setTokenPrefix(String tokenPrefix) {
        this.tokenPrefix = tokenPrefix;
    }

    public String getHeader() {
        return header;
    }

    public void setHeader(String header) {
        this.header = header;
    }

    public long getRefreshExpiration() {
        return refreshExpiration;
    }

    public void setRefreshExpiration(long refreshExpiration) {
        this.refreshExpiration = refreshExpiration;
    }
}